#include <iostream>
#include <math.h>
using namespace std;

float R;
int n;

#define PI 3.14159265
//#define DEBUG

int main() {
    int k;

    cin >> k;
    for (int i = 1; i <= k; i++) {
        cin >> R >> n;
#if defined(DEBUG)
        cout << "R: " << R << "\t";
        cout << "n: " << n << endl;
#endif
        
        cout << "Scenario #" << i << ":" << endl;
        cout.precision(3);
        cout.setf(ios::fixed); 
        cout << (R*sin(2*PI/n/2)) / (1 + sin(2*PI/n/2)) << endl;
        cout << endl;



    }
    return 0;
}
